Optimal. Leaf size=134 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{32 \sqrt {2} a^{3/2} f}+\frac {\cos (e+f x)}{32 f (a+a \sin (e+f x))^{3/2}}-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2791, 2934,
2729, 2728, 212} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{32 \sqrt {2} a^{3/2} f}+\frac {\cos (e+f x)}{32 f (a \sin (e+f x)+a)^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a \sin (e+f x)+a}}-\frac {\sec (e+f x)}{4 f (a \sin (e+f x)+a)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2729
Rule 2791
Rule 2934
Rubi steps
\begin {align*} \int \frac {\tan ^2(e+f x)}{(a+a \sin (e+f x))^{3/2}} \, dx &=-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {\int \frac {\sec ^2(e+f x) \left (-\frac {3 a}{2}+4 a \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{4 a^2}\\ &=-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a+a \sin (e+f x)}}-\frac {1}{16} \int \frac {1}{(a+a \sin (e+f x))^{3/2}} \, dx\\ &=\frac {\cos (e+f x)}{32 f (a+a \sin (e+f x))^{3/2}}-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a+a \sin (e+f x)}}-\frac {\int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx}{64 a}\\ &=\frac {\cos (e+f x)}{32 f (a+a \sin (e+f x))^{3/2}}-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a+a \sin (e+f x)}}+\frac {\text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{32 a f}\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{32 \sqrt {2} a^{3/2} f}+\frac {\cos (e+f x)}{32 f (a+a \sin (e+f x))^{3/2}}-\frac {\sec (e+f x)}{4 f (a+a \sin (e+f x))^{3/2}}+\frac {5 \sec (e+f x)}{8 a f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.29, size = 128, normalized size = 0.96 \begin {gather*} -\frac {\sec (e+f x) \left (-25-\cos (2 (e+f x))+(2+2 i) (-1)^{3/4} \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^4-40 \sin (e+f x)\right )}{64 f (a (1+\sin (e+f x)))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.05, size = 202, normalized size = 1.51
method | result | size |
default | \(\frac {\sin \left (f x +e \right ) \left (2 \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a^{2}+40 a^{\frac {5}{2}}\right )+\left (-\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a^{2}+2 a^{\frac {5}{2}}\right ) \left (\cos ^{2}\left (f x +e \right )\right )+2 \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a^{2}+24 a^{\frac {5}{2}}}{64 a^{\frac {7}{2}} \left (1+\sin \left (f x +e \right )\right ) \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(202\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs.
\(2 (119) = 238\).
time = 0.36, size = 259, normalized size = 1.93 \begin {gather*} \frac {\sqrt {2} {\left (\cos \left (f x + e\right )^{3} - 2 \, \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right )\right )} \sqrt {a} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )} + 3 \, a \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right ) - 2 \, a\right )} \sin \left (f x + e\right ) + 2 \, a}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right ) - 4 \, {\left (\cos \left (f x + e\right )^{2} + 20 \, \sin \left (f x + e\right ) + 12\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{128 \, {\left (a^{2} f \cos \left (f x + e\right )^{3} - 2 \, a^{2} f \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 2 \, a^{2} f \cos \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (e + f x \right )}}{\left (a \left (\sin {\left (e + f x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 12.39, size = 127, normalized size = 0.95 \begin {gather*} \frac {\frac {8 \, \sqrt {2}}{a^{\frac {3}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (\frac {3}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )} - \frac {\sqrt {2} {\left (9 \, \sqrt {a} \sin \left (\frac {3}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 7 \, \sqrt {a} \sin \left (\frac {3}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\sin \left (\frac {3}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{2} a^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{64 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {tan}\left (e+f\,x\right )}^2}{{\left (a+a\,\sin \left (e+f\,x\right )\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________